// 计时器
// 这是一个单例类

#ifndef ALICE_TIMER_TIMER_H_
#define ALICE_TIMER_TIMER_H_

#include <SDL.h>

namespace alice {

constexpr int kTargetFps = 60;
constexpr double kTargetDeltaTime = 1.5f;

class Timer {
  public:
    static Timer* GetInstance() {
      return instance_ = (instance_ == nullptr ? new Timer() : instance_);
    }

    void Tick();
    double GetDeltaTime() { return delta_time_; }


  private:
    Timer() {}

  private:
    static Timer* instance_;
    double delta_time_;
    double last_time_;
};

}

#endif // ALICE_TIMER_TIMER_H_

